home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mastering Web Site Development
/
Microsoft Mastering Web Site Development (Microsoft) (1997).iso
/
Demo Code
/
Ch10
/
grades.asp
next >
Wrap
Text File
|
1997-04-24
|
1KB
|
49 lines
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>
<!-- Insert HTML here -->
<%
Const adOpenKeyset=1
Const adLockOptimistic = 3 %>
You logged on as: <%=request.servervariables("LOGON_USER") %> <p>
<TABLE>
<%
login=request.servervariables("LOGON_USER")
set rs = Server.CreateObject ("ADODB.Recordset")
if strcomp (login, "instructor",1) = 0 THEN
rs.Open "Select StudentID, Grade from enrollment", _
"DSN=Stateu;DATABASE=StateU;UID=sa;PWD="
else
rs.Open "Select ClassID, StudentID from enrollment", _
"DSN=stateu;DATABASE=StateU;UID=sa;PWD="
end if
Set StateU = Server.CreateObject("ADODB.Connection")
response.write "<TR>"
response.write "<TH>" & rs.fields(0).name & "</TH>"
response.write "<TH>" & rs.fields(1).name & "</TH>"
response.write "</TR>"
Do Until rs.EOF
response.write "<TR>"
response.write "<TD>" & rs.fields(0).value & "</TD>"
if isnull(rs.fields(1).value) then
response.write "<TD>Unavailable</TD>"
else
response.write "<TD>" & rs.fields(1).value & "</TD>"
end if
response.write "</TR>"
rs.MoveNext
Loop
%>
</Table>
</BODY>
</HTML>